<template>
  <div id="app" v-cloak>
    <router-view />
  </div>
</template>

<script>
import jwt_decode from "jwt-decode";

export default {
  name: "App",
  created() {
    if (localStorage.auth) {
      const decode = jwt_decode(localStorage.auth);
      this.$store.dispatch("setIsAuthenticated", true);
      this.$store.dispatch("setUser", decode);
    }
  }
};
</script>

<style lang='scss'>
#app {
  font-size: 14px;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, Helvetica Neue,
    PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  [v-cloak] {
    display: none !important;
  }
}
</style>
